package day06.test1;

import java.util.Arrays;

public class test1 {
    public static void main(String[] args) {
        int[] arr1 = {6,643,7654,234,548,5432};
        int[] arr2 = new int[10];
        int j =0;
        for(int i =4;i<10;i++ )
        {
            arr2[i] = arr1[j];
            j++;
        }
        for(int i =0;i<10;i++ )
        {
            System.out.println(arr2[i]);
        }
        System.out.println(Arrays.toString(arr2)); //输出数组
        int[] arr3 = new int[10];
        //数组的复制 （被复制的数组，起始下标，目标数组，起始下标，几个元素）
        System.arraycopy(arr1,0,arr3,4,6);
        System.out.println(Arrays.toString(arr3)); //输出数组
        int[] arr5 = Arrays.copyOf(arr1, 4); //新数组的长度  未复制的为0
        System.out.println(Arrays.toString(arr5)); //输出数组


    }
}
